package com.ssy.lingxi.settle.accounts.service;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.dto.request.InvoiceProveGetVO;
import com.ssy.lingxi.dto.request.MemberReceiptInvoiceBaseVO;
import com.ssy.lingxi.dto.response.InvoiceProveVO;
import com.ssy.lingxi.settle.accounts.model.vo.request.*;
import com.ssy.lingxi.settle.accounts.model.vo.response.MemberReceiptInvoiceDetailVO;
import com.ssy.lingxi.settle.accounts.model.vo.response.MemberReceiptInvoiceVO;
import com.ssy.lingxi.settle.accounts.model.vo.response.MemberReturnReceiptInvoiceDetailVO;

import java.util.List;

/**
 * 开票管理接口定义
 * @author 伍将
 * @date 2020/10/27
 * @version 2.0.0
 */
public interface IMemberReceiptInvoiceService {

    /**
     * 分页查询票据管理列表
     * @author 伍将
     * @date 2020/10/28
     * @param sysUser: 当前登录用户
     * @param pageVO: 分页查询参数
     * @return com.ssy.lingxi.common.response.Wrapper<com.ssy.lingxi.common.response.PageData < com.ssy.lingxi.settle.accounts.mode.vo.response.MemberReceiptInvoiceVO>>
     **/
    Wrapper<PageData<MemberReceiptInvoiceVO>> pageReceiptInvoice(UserLoginCacheDTO sysUser, MemberReceiptInvoicePageVO pageVO);

    /**
     * 开票
     * @author 伍将
     * @date 2020/10/28
     * @param sysUser: 当前登录用户
     * @param addVO: 开票信息
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> invoice(UserLoginCacheDTO sysUser, AddReceiptInvoiceVO addVO);

    /**
     * 获取发票详情
     * @param sysUser：当前登录用户
     * @param receiptInvoiceId：开票数据id
     * @return 发票
     */
    Wrapper<MemberReceiptInvoiceDetailVO> getInvoiceProveDetail(UserLoginCacheDTO sysUser, Long receiptInvoiceId);

    /**
     * 售后退货开票
     * @author 伍将
     * @date 2020/10/28
     * @param sysUser: 当前登录用户
     * @param addVO: 开票信息
     * @return com.ssy.lingxi.common.response.Wrapper
     **/
    Wrapper<Void> invoiceByReturn(UserLoginCacheDTO sysUser, AddReceiptInvoiceListVO addVO);

    /**
     * 获取退货发票详情
     * @param sysUser：当前登录用户
     * @param receiptInvoiceId：开票数据id
     * @return 发票列表
     */
    Wrapper<List<MemberReturnReceiptInvoiceDetailVO>> getReturnInvoiceProveDetail(UserLoginCacheDTO sysUser, Long receiptInvoiceId);

    /**
     * 获取发票凭证
     * @author 伍将
     * @date 2021/3/10
     * @param sysUser: 当前登录用户
     * @param getVO: 请求参数
     * @return 操作结果
     **/
    Wrapper<List<InvoiceProveVO>> getInvoiceProve(UserLoginCacheDTO sysUser, InvoiceProveGetVO getVO);

    /**
     * 统一新增开票管理入口
     * @param saveVO 新增开票管理信息
     * @return 开票新增结果
     */
    Wrapper<Void> save(MemberReceiptInvoiceBaseVO saveVO);

    /**
     * 更新开票记录支付状态为支付
     * @param invoiceIdList 开票id集合
     * @param type 订单类型
     * @param dataId 关联数据id
     * @return 更新结果
     */
    Wrapper<Void> pay(List<Long> invoiceIdList, Integer type, Long dataId);

    /**
     * 生成批量开票提交数据
     * @param sysUser 登录用户
     * @param receiptInvoiceIds 开票id
     * @return 批量开票提交数据
     */
    Wrapper<AddBatchReceiptInvoiceVO> generateBatchInvoiceProve(UserLoginCacheDTO sysUser, AddBatchReceiptInvoiceIdsVO receiptInvoiceIds);

    /**
     * 批量开票
     * @param sysUser 登录用户
     * @param batchAddVO 批量开票实体
     * @return 批量开票结果
     */
    Wrapper<Void> batchInvoiceProve(UserLoginCacheDTO sysUser, AddBatchReceiptInvoiceVO batchAddVO);
}
